<template>
<h1>EL-菜单组件</h1>
  <el-menu mode="horizontal" @select="handleSelect" style="background-color: lightpink" text-color="red" active-text-color="blue" >
    <el-menu-item index="1">首页</el-menu-item>
    <el-menu-item index="2">免费课</el-menu-item>
    <el-menu-item index="3">直播课</el-menu-item>
    <el-menu-item index="4">线上课</el-menu-item>
    <el-menu-item index="5">脱产课</el-menu-item>
    <el-sub-menu index="6">
      <template #title>关于我们</template>
      <el-menu-item index="6-1">联系方式</el-menu-item>
      <el-menu-item index="6-2">公司地址</el-menu-item>
      <el-menu-item index="6-3">求职招聘</el-menu-item>
    </el-sub-menu>
  </el-menu>
  <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
    <el-menu-item index="1">处理中心</el-menu-item>
  </el-menu>

</template>

<script setup>
import { ref } from 'vue'
import index from "vuex";
import {ElMessage} from "element-plus";

const handleSelect = (key , keyPath ) => {
  console.log(key, keyPath)
  if(key==3){
    ElMessage.success('您选择了直播课！');
  }
}
</script>

<style scoped>

</style>